package GUI;


import java.awt.BorderLayout;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;

import javax.swing.JTextField;

//import GUI.PfAdd_new_employee;

public class VKTextField extends JTextField implements FocusListener {
	
	private MainMenu mainMenu;
	
	public VKTextField(final MainMenu mm)
	{
		super();
		mainMenu=mm;
		this.addFocusListener( this);
		
	}
	
	
	public VKTextField(String str , final MainMenu mm)
	{
		super(str);
		mainMenu=mm;
		this.addFocusListener( this);
		
	}

	@Override
	public void focusGained(FocusEvent arg0) {
		JTextField text=((JTextField)arg0.getSource());
		mainMenu.keyboard.T.position=text.getCaretPosition();
		mainMenu.keyboard.T.TextField=text;		
		mainMenu.keyBoardDigits.T.position=text.getCaretPosition();
		mainMenu.keyBoardDigits.T.TextField=text;
		mainMenu.keyBoardDigits.T.KBSwitch=0;
		mainMenu.keyboard.T.KBSwitch=0;
		
		
	}

	@Override
	public void focusLost(FocusEvent arg0) {
		//mainMenu.keyboard.T.TextField=null;
		
	}

}
